<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!--Hier fuegt man seinen Arbeitsgeber  oder Firmennamen ein und beschreibt von wann bis wann man in der Firma gearbeitet hat... -->
<%String file="./index.jsp?"+Constant.CONTENT+"="+Constant.add_group, method="get"; %>
<%@page import="db.DBMain"%>
<%RequestParser.send_action_file=file;
RequestParser.send_method=method;%>
<%@include file="town.jsp" %>
<%@page import="html.RequestParser"%>
<%@page import="db.tables.DBTypeTable"%>
<%@page import="java.sql.Date"%>
<%@page import="db.tables.DBGroupTable"%>
<%@page import="db.tables.reference.DBScholarAtTable"%>
<script type="text/javascript"><!--

<%
Long type_id_temp=DBMain.getTypeTable().selectLong(DBTypeTable.TYPE_ID_COL,DBTypeTable.TYPE_NAME_COL,Constant.Type.GROUP),
	user_id=0L, cat_id=RequestParser.getLongFromParameter(request,Constant.Content.CATEGORY);//session.getAttribute(Constant.USERID);
session.setAttribute(Constant.Content.TYPE,type_id_temp);

RequestParser groupParser=new RequestParser(request,file,method);
groupParser.isAdmin(true);
groupParser.setAdd(Constant.Content.ADD_GROUP);
groupParser.setContent(Constant.Content.GROUP);
groupParser.setSubmit(Constant.Content.SUBMIT_GROUP);
groupParser.setDelete(Constant.Content.DELETE_GROUP);
groupParser.setInput(new String[]{Constant.Content.INPUT_GROUP,Constant.Content.INPUT_GROUP_HOMEPAGE,Constant.Content.TOWN,Constant.Content.CATEGORY});
groupParser.setInsert_columns(new String[]{DBGroupTable.GROUP_NAME_COL,DBGroupTable.HOMEPAGE_COL,DBGroupTable.TOWN_ID_COL,DBGroupTable.CATEGORY_ID_COL});
groupParser.setDisplay_columns(new String[]{DBGroupTable.GROUP_ID_COL,DBGroupTable.GROUP_NAME_COL,DBGroupTable.CATEGORY_ID_COL});
groupParser.setPk_column(DBGroupTable.GROUP_ID_COL);
groupParser.setTable(DBMain.getGroupTable());
groupParser.setFk_columns(new String[]{DBGroupTable.TOWN_ID_COL,DBGroupTable.CATEGORY_ID_COL});
groupParser.setFk_ids(new Long[]{town_id,cat_id});
groupParser.process();

%>
//
--></script>
<form name="<%=groupParser.getContent() %>" action="<%=groupParser.getSend_action_file() %>" method="<%=groupParser.getSend_method()%>">
<%@include file="category_only.jsp" %>
	<select name="<%=groupParser.getContent() %>" onchange="submit()">
		<%
			groupParser.printOptionList(out);
		%>
	</select>
<% if(admin) { %>
	<input type="hidden" name="<%=Constant.Content.CATEGORY %>" value="<%=categoryParser.getPk_id() %>"/>
    <input type="hidden" name="<%=Constant.Content.COUNTRY %>" value="<%=country_id %>"/>
	<input type="hidden" name="<%=Constant.Content.TOWN %>" value="<%=town_id %>"/> 
    <input name="<%=groupParser.getContent()%>" type="hidden" value="<%=type_id_temp %>"/>
	<input name="<%=groupParser.getDelete() %>" value="<%=Constant.Content.DELETE %>" type="submit"/>
<% } %>
<% if(admin) { %>
	<table>
	<tr><td>Gruppenname</td></tr>
	<tr>
	<td><input name="<%=groupParser.getInput()[0] %>" type="text"/></td>
	</tr>
	<tr><td>Homepage</td></tr>
	<tr>
	<td><input name="<%=groupParser.getInput()[1] %>" type="text"/></td>
	</tr>
	</table>
    <input type="hidden" name="<%=Constant.Content.COUNTRY %>" value="<%=country_id %>"/>
	<input type="hidden" name="<%=Constant.Content.TOWN %>" value="<%=town_id %>"/> 
	<input name="<%=groupParser.getSubmit() %>" type="submit"/>
	<input type="reset" name="Zur&uuml;cksetzen" value="Zur&uuml;cksetzen">
</form>
<%}%>